home *** CD-ROM | disk | FTP | other *** search
- Path: newsflash.concordia.ca!not-for-mail
- From: ac_march@ece.concordia.ca (Angus C. March)
- Newsgroups: comp.lang.c
- Subject: gcc bug w/getenv? (running Linux)
- Date: 7 Feb 1996 00:49:18 GMT
- Organization: ECE - Concordia University
- Message-ID: <4f8sue$84d@newsflash.concordia.ca>
- NNTP-Posting-Host: hollister.ece.concordia.ca
- NNTP-Posting-User: ac_march
- X-Newsreader: TIN [version 1.2 PL2]
-
- I seem to suffer this bizarre bug in gcc-2.6.3, that run on Linux 1.2.13. I
- tried to assigning a getenv() pointer to a varaible of type char *, but I
- got a warning about assigning an integer to a pointer. I tried this little
- experiement:
- #include <stdio.h>
-
- int main()
- {
- char *temp;
- int thingi;
-
- temp = (char *)getenv("TERM");
- thingi = getenv("TERM");
- printf("getenv(term): %s\ntemp: %s\nthingi: %s\n", getenv("TERM"),
- temp, thingi);
-
- return 0;
- }
- The results where facinating:
- getenv(term): vt100
- temp: vt100
- thingi: vt100
- Is this a bona fide bug?
-
- --
- http://www.ece.concordia.ca/~ac_march/addr.html
- _________ ___________ ac_march@ece.concordia.ca
- |.........| |Attempting |
- |: DON'T :| |recovery...| Angus March
- |: PANIC :| |1067 pages | The Ultra-Mind Dragon
- |:.......:| |unrecovered| -==(UDIC)==-
- |---------|___ __|___________|__
- /___________\ |_________________| Murphy ain't seen nothing yet
-